// https://leetcode.cn/problems/toeplitz-matrix/
// Created by ade on 2022/8/16.
//
#include <iostream>
#include <vector>


using namespace std;

class Solution {
public:
    bool isToeplitzMatrix(vector <vector<int>> &matrix) {
        int row = matrix.size();
        int col = matrix[0].size();
        if (row <= 1 || col <= 1) return true;
        for (int i = 1; i < row; i++) {
            for (int j = 1; j < col; j++) {
                if (matrix[i - 1][j - 1] != matrix[i][j]) return false;
            }
        }
        return true;
    }
};

int main() {
    vector <vector<int>> nums = {{11, 74, 0,  93},
                                 {40, 11, 74, 7}};
    Solution so;
    cout << so.isToeplitzMatrix(nums) << endl;
    return 0;
}